package com.project.visuallinks.client;

import java.util.ArrayList;


public class Tag {
	private String strTag = new String();
	private ArrayList<Links> linkList = new ArrayList<Links>();
	private int nrLinks;
	
	
	public Tag(String name)
	{
		strTag = name;
		nrLinks = 0;
	}
	
	public Tag(String name, int nrLinks)
	{
		strTag = name;
		this.nrLinks = nrLinks;
	}
	
	public void addLink(Links link)
	{
		linkList.add(link);
	}
	
	public void deleteLink(int index)
	{
		linkList.remove(index);
	}
	
	public Links getLink(int index)
	{
		return linkList.get(index);
	}

	public int getNrLinks() {
		return nrLinks;
	}

	public void setNrLinks(int nrLinks) {
		this.nrLinks = nrLinks;
	}
	
	public String getTagText() {
		return strTag;
	}

	public void setTagText(String strTag) {
		this.strTag = strTag;
	}

	public int getEffectiveNrLinks() {
		return linkList.size();
	}
	
	public void purgeLinksList() {
		linkList.clear();
	}
}
